<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">

    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
    var setting = {data:{simpleData:{enable:true,idKey:"id",pIdKey:"pId",rootPId:'0'}},
        callback:{onClick:function(event, treeId, treeNode){
                loadDiv('rigthCenterDiv',"${ctx}/oper/labVsClinic/labItemsRight?labTypeId="+treeNode.id);
        }
        }
    };
    //加载添加页面
    function loadLabClinic(divId,url){
        var nodes = [];
        nodes=labTypeTree.getSelectedNodes();
        if(nodes.length==0){
            toastr.error("请选择检验类别");
            return;
        }
//        $("#"+divId).load(url+"?labId="+nodes[0].id);
        loadDiv(divId, url+"?labId="+nodes[0].id)
    }

    $.getJSON("${ctx}/oper/labType/treeData",function(data){
        labTypeTree=$.fn.zTree.init($("#ztree"), setting, data)
        labTypeTree.expandAll(true);
        if("${labTypeId}"!=""){
            var node = labTypeTree.getNodeByParam("id","${labTypeId}");
            labTypeTree.selectNode(node);
        }
    });
</script>
<div class="app">
    <section class="layout">
        <aside class="sidebar-250 canvas-right bg-default ">
            <header class="header navbar clearfix bb bg-default pl0 pr0">
                <p class="navbar-text">检验类别</p>
                <div class="btn-group pull-right mr10">
                    <button type="button" class="btn btn-sm btn-primary navbar-btn">
                        <i class="ti-comment-alt"></i>
                    </button>
                    <button type="button" class="btn btn-sm btn-primary navbar-btn">
                        <i class="ti-help-alt"></i>
                    </button>
                </div>
            </header>

            <div class="content-wrap no-p">

                <div class="wrapper">

                    <div class="m15">
                        <div id="ztree" class="ztree">

                        </div>
                    </div>

                </div>
            </div>
        </aside>
        <section class="main-content" id="rigthCenterDiv">
            <jsp:include page="labVsClinicRight.jsp"/>
        </section>
    </section>
</div>